﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="editPaper.aspx.vb" Inherits="MobileStandards.editPaper" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="mobilestandards.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" DataSourceID="db">
            <Columns>
                <asp:CommandField ShowEditButton="True" ShowDeleteButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" Visible="False" />
                <asp:BoundField DataField="Author" HeaderText="Author" 
                    SortExpression="Author" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:TemplateField HeaderText="Abstract" SortExpression="Abstract">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Abstract") %>' TextMode="MultiLine" Rows="5"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Abstract") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Intro" SortExpression="Intro">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Intro") %>' TextMode="MultiLine" Rows="5"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Intro") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Hyperlink" HeaderText="Hyperlink" 
                    SortExpression="Hyperlink" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="db" runat="server" 
            ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\mobilestandards.accdb" 
            DeleteCommand="DELETE FROM [papers] WHERE [ID] = ?" 
            InsertCommand="INSERT INTO [papers] ([ID], [Author], [Title], [Abstract], [Intro], [Hyperlink]) VALUES (?, ?, ?, ?, ?, ?)" 
            ProviderName="System.Data.OleDb" 
            SelectCommand="SELECT [ID], [Author], [Title], [Abstract], [Intro], [Hyperlink] FROM [papers]" 
            UpdateCommand="UPDATE [papers] SET [Author] = ?, [Title] = ?, [Abstract] = ?, [Intro] = ?, [Hyperlink] = ? WHERE [ID] = ?">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Author" Type="String" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Abstract" Type="String" />
                <asp:Parameter Name="Intro" Type="String" />
                <asp:Parameter Name="Hyperlink" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ID" Type="Int32" />
                <asp:Parameter Name="Author" Type="String" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Abstract" Type="String" />
                <asp:Parameter Name="Intro" Type="String" />
                <asp:Parameter Name="Hyperlink" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
